<?php
require 'config.php';
$id = (int)($_GET['id'] ?? 0);
$pdo->prepare("DELETE FROM notes WHERE id = ?")->execute([$id]);
header('Location: index.php');
exit;